#include <bits/stdc++.h>
using namespace std;
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
using ll = long long;
 
void solve()
{
    ll n, m;
    cin >> n >> m;
    string s, c;
    cin >> s >> c;
    sort(c.begin(), c.end());
 
    string ans = "";
    ll i = 0, j = 0;
    while (i < s.size() && j < c.size())
    {
        if (s[i] <= c[j])
        {
            ans += s[i];
            i++;
        }
        else
        {
            ans += c[j];
            j++;
        }
    }
    while (i < s.size())
    {
        ans += s[i];
        i++;
    }
    while (j < c.size())
    {
        ans += c[j];
        j++;
    }
    cout << ans << endl;
}
 
int main()
{
    int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}